package com.cskaoyan.javase.oop2._1extends._8hidden.exercise;

/**
 *
 * @since 11:30
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        Son s = new Son(100, 28);
        System.out.println(s.num);
        System.out.println(s.age);

        Father fs = new Son(100, 200, 30);
        System.out.println(fs.num);

        Father f = new Father(1000);
        System.out.println(f.num);
    }
}

class Father {
    int num;
    String name;

    public Father(int num) {
        this.num = num;
    }

    public Father() {
    }
}

class Son extends Father {
    int num;
    int age;


    public Son() {
    }

    public Son(int num, int num1, int age) {
        super(num);
        this.num = num1;
        this.age = age;
    }

    public Son(int num, int age) {
        this.num = num;
        this.age = age;
    }
}